package com.infitecs.eyas.suction.service;

import com.infitecs.eyas.session.SessionService;
import com.infitecs.eyas.suction.dao.SuctionSummaryDao;
import com.infitecs.eyas.suction.model.SuctionSummary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by pzw on 2015/8/29.
 */
@Service
public class SuctionSummaryService {

    @Autowired
    private SuctionSummaryDao suctionSummaryDao;

    @Autowired
    private SessionService sessionService;


    public SuctionSummary getSuctionSummary() {
        return suctionSummaryDao.getSunmmaryByCaseId(sessionService.getCaseId());
    }

    public void insertNewSummary() {
        suctionSummaryDao.insertNewSummary(sessionService.getCaseId());
    }

    public void updateParam(SuctionSummary suctionSummary) {
        int caseId = sessionService.getCaseId();
        suctionSummary.setCaseId(caseId);
        suctionSummaryDao.updateParam(suctionSummary);
    }

}
